﻿#region License
/*
 *CopyRight (c) By Denuvead All Rights Reserved
 *CreateDate:
 *Info:
 */
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PriErp.Commands;
using System.Drawing;
using PriErp.Tools.Extensions;

namespace PriErp.Frm
{
    public static partial class FrmExtension
    {
        /// <summary>
        /// 显示遮盖层
        /// </summary>
        /// <param name="Showctl">显示内容</param>
        public static void ShowOpaqueLayer(this Control ctl, Control Showctl, OpaqueLayerCtl layerCtl)
        {
            ctl.UIThread(delegate
            {
                
                ctl.Controls.Add(layerCtl);
                layerCtl.Dock = DockStyle.Fill;
                Point p = new Point((ctl.ClientRectangle.Width - Showctl.Width) / 2, (ctl.ClientRectangle.Height - Showctl.Height) / 2);//居中
                Showctl.Location = p;
                Showctl.Anchor = AnchorStyles.None;
                layerCtl.Controls.Add(Showctl);
                layerCtl.BringToFront();
            });
        }
    }
}
